package net.child.chess.pieces;

import java.util.List;

import net.child.chess.utils.ChessDef;

//	The IMoves provide interface for all pieces classes to 
//	determine which squares could be attacked or where the pieces could move.
//	This interface is implemented by the class board.
public interface IMoves 
{
	//	Return whether a piece of specific color could move from one position to another position.
	//	The method will check the following:
	//	1. The king isn't under attack.
	//	2. the "to" is empty or there is a piece with different color.
	boolean isValidMove(Piece fromPiece, int toPosition);
	
	//	Check whether the king that belongs to specific color is under attack or not. 
	boolean isKingUnderAttack(ChessDef.Color color);
	
	//	return true if at position square there is a piece with different color.
	boolean isOpponentSquare(ChessDef.Color myColor, int position);
	
	boolean isEmptySquare(int position);
	
	//	return true if a piece of specific color exists at specific position
	boolean isPieceExist(Piece.Type type, ChessDef.Color color, int position);
	
	//	return whether the piece at position was moved before.
	boolean wasPieceMoved(int position);
	
	List<MoveInfo> currentMove();
	
	List<MoveInfo> previousMove();
}
